package info.wangyuan.agent.valid;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * 自定义名称校验注解
 *
 * @author Albert
 * @since 2025-08-16 15:57:45
 */
@Documented
@Constraint(validatedBy = ValidNameValidator.class)
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidName {

    String message() default "无效的名称";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    // 如果用户不传，使用默认值
    int min() default 1;

    int max() default 32;
}
